<template>
  <div>
    <div>
      <div>{{ str }}</div>
      <br />
      <button @click="reverseStr">逆转</button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      str: '鸡你,太美',
    }
  },
  methods: {
    reverseStr() {
      this.str = this.str.split('').reverse().join('')
      // .split('')转数组.reverse()翻转.join('')转字符串
    },
  },
}
</script>

<style scoped></style>
